<template>
  <div>
    <el-row :gutter="15">
        <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="130px" style="display: flex;">
          <el-col :span="12">
            <el-row gutter="15" class="title">
              <span>Kegel模板训练</span>
            </el-row>
            <el-row gutter="15">
              <el-col :span="20">
                <el-form-item label="强度(μV)" prop="kegelqd">
                  <el-input v-model="formData.kegelqd" placeholder="请输入强度(μV)" clearable >
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col :span="20">
                <el-form-item label="治疗时间(min)" prop="kegelzlsj">
                  <el-input v-model="formData.kegelzlsj" placeholder="请输入治疗时间(min)" clearable
                            :style="{width: '100%'}"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="20">
                <el-form-item label="收缩时间(s)" prop="kegelsssj">
                  <el-input v-model="formData.kegelsssj" placeholder="请输入收缩时间(s)" clearable
                            :style="{width: '100%'}"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="20">
                <el-form-item label="治疗天数(天)" prop="kegelzlts">
                  <el-input v-model="formData.kegelzlts" placeholder="请输入治疗天数(天)" clearable
                            :style="{width: '100%'}"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </el-col>
          <el-col :span="12">
            <el-row gutter="15" class="title">
              <span>电刺激</span>
            </el-row>
            <el-row gutter="15">
              <el-col :span="20">
                <el-form-item label="电流强度(μV)" prop="dcjqd">
                  <el-input v-model="formData.dcjqd" placeholder="请输入电流强度" clearable
                            :style="{width: '100%'}"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="20">
                <el-form-item label="治疗时间(min)" prop="dcjzlsj">
                  <el-input v-model="formData.dcjzlsj" placeholder="请输入治疗时间(min)" clearable
                            :style="{width: '100%'}"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="20">
                <el-form-item label="频率(hz)" prop="dcjpl">
                  <el-input v-model="formData.dcjpl" placeholder="频率(hz)" clearable
                            :style="{width: '100%'}"></el-input>
                </el-form-item>
              </el-col>
            </el-row>

          </el-col>

        </el-form>
    </el-row>
    <div slot="footer" style="display: block;text-align: right;">
      <el-button @click="close">取消</el-button>
      <el-button type="primary" @click="submitForm">确定</el-button>
    </div>
  </div>
</template>
<script>
import {getPrescriptione} from '@/api/login'
export default {
  components: {},
  props: {
    pData:{
      type: Object,
      default:{}
    }
  },
  data() {
    return {
      formData: {
        kegelqd: undefined,
        kegelzlsj: undefined,
        kegelsssj: undefined,
        kegelzlts: undefined,
        dcjqd: undefined,
        dcjzlsj: undefined,
        dcjpl: undefined,
      },
      rules: {
        kegelqd: [{
          required: true,
          message: '请输入强度(μV)',
          trigger: 'blur'
        }],
        kegelzlsj: [{
          required: true,
          message: '请输入治疗时间(min)',
          trigger: 'blur'
        }],
        kegelsssj: [{
          required: true,
          message: '请输入收缩时间(s)',
          trigger: 'blur'
        }],
        kegelzlts: [{
          required: true,
          message: '请输入治疗天数(天)',
          trigger: 'blur'
        }],
        dcjqd: [{
          required: true,
          message: '请输入电流强度',
          trigger: 'blur'
        }],
        dcjzlsj: [{
          required: true,
          message: '请输入治疗时间(min)',
          trigger: 'blur'
        }],
        dcjpl: [{
          required: true,
          message: '频率(hz)',
          trigger: 'blur'
        }],
      },
    }
  },
  computed: {},
  watch: {},
  created() {
    this.formData = this.pData
  },
  mounted() {},
  methods: {
    submitForm() {
      var _that = this
      _that.$refs['elForm'].validate(valid => {
        if (!valid) return
        this.$emit("comfirm",this.formData)
      })
    },
    resetForm() {
      this.$refs['elForm'].resetFields()
    },
    close(){
      this.$emit("close")
    }
  }
}

</script>
<style>

.title {
  display: block;
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  margin-top: -20px;
  margin-bottom: 20px;
}
</style>
